﻿@model Model.VenderUser
@{
    ViewBag.Title = "供应商证书管理";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@section JQscriptSection{
    <script src="../../Scripts/viewsScript/VenderUserLicense/VenderUserLicenseC.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/datagrid-detailview.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.easy.ui.extend.js" type="text/javascript"></script>
    <script src="../../Scripts/viewsScript/Ability/PrintHelp.js"></script>
    <script type="text/javascript">

        $(function () {
            //var curr_time = new Date();
            //var strDateEnd = curr_time.getFullYear() + "-";
            //strDateEnd += curr_time.getMonth() + 1 + "-";
            //strDateEnd += curr_time.getDate();
            //var strdate = curr_time.getFullYear() + "-";
            //strdate += curr_time.getMonth() + 1 + "-";
            //strdate += curr_time.getDate();
            //$("#CheckTimeS").datebox("setValue", strdate);
            //$("#CheckTimeE").datebox("setValue", strDateEnd); 
        });

        function Import() {
            var form = $('#venderuserlicense');
            form.form('submit', {
                url: '/BaseData/ImportFile',
                success: function (data) {
                    eval('data=' + data);
                    if (data.success) {
                        //InitGrid();
                        $("#ImgURL").val(data.msg);
                        $("#ImgName").val(data.ImgName);
                        $("#image").attr("style", "display:normal");
                        $("#ShowImgName").html(data.ImgName);
                        $.messager.alert('提示', '上传成功', 'warning');
                    } else {
                        $.messager.alert('提示', data.msg, 'warning');
                    }
                }
            });
        };
        function DeleteImage() {
            $("#image").attr("style", "display:none");
            $("#FileUpload").val("");
            $("#ImgURL").val("");
            $("#ImgName").val("");
        };
        //页面加载
        $(function () {
            //加载菜单
            // InitGrid();
            $('#loginOut').click(function () {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function (r) {
                    if (r) {
                        $.ajax({
                            type: "POST",
                            url: '@Url.Action("LogOut", "Account")',
                            success: function (data) {
                                location.href = '@Url.Action("LogOn", "Account")';
                            }
                        });
                        }
                });
            })
        });

    </script>
}

<body style="background-color:ButtonFace;font-size:17px" onload="InitGrid();">
    <div region="north" split="true" border="false" style="overflow: hidden; height: 51px; color: #000000; background: url(../Content/Ext/resources/themes/images/gray/panel-header-default-bottom-bg.gif); font-family: Verdana, 微软雅黑,黑体">
        <span style="float: right; padding-right: 10px; padding-top: 30px;" class="head">欢迎:@Model.USERNAME <a
            href="#" id="loginOut">安全退出</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Home/Index" id="HomeIndex">返回首页</a></span>
        @*<img src="../../Content/themes/base/images/logo.png" height="50" align="absmiddle" />*@
        <span style="padding-left: 10px; font-size: 20px;">
            <img src="/Content/images/blocks.gif" width="20" height="20" align="absmiddle" />
            我厨&reg - 供应商证书管理
        </span>
    </div>
    <div id="p2" class="easyui-panel" title="查询条件" style="height: 35px; padding: 5px; background: #fafafa;">
        <table>
            <tr>
                <td>证书类型:
                </td>
                <td>
                    <select id="SLICENSE_TYPE" class="easyui-combogrid" name="SLICENSE_TYPE" style="width: 120px;"
                            data-options="
                        idField:'Value',
                        textField:'Text',
                        url:'@Url.Content("/VenderUserLicense/LicenseTypeList?IsSetAll=true")',
                        columns:[[
                            {field:'Text',title:'证书类型',width:116}
                        ]]
                    ">
                    </select>
                </td>
                @*<td>有效日期：
                </td>
                <td>
                    <input class="easyui-datebox" id="CheckTimeS" name="CheckTimeS" style="width: 140px;" editable="false" />
                </td>
                <td>~：
                </td>
                <td>
                    <input class="easyui-datebox" id="CheckTimeE" name="CheckTimeE" style="width: 140px;" editable="false" validtype="compareDate['#CheckTimeS']" />
                </td>*@
                <td>
                    <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                </td>
            </tr>
        </table>
    </div>
    <div>
        <table id="tab_list" data-options="sum:true">
        </table>
    </div>

    <div id="p1" class="easyui-dialog" style="width: 650px; height: 240px; padding: 10px 20px" closed="true" buttons="#dlg-buttons">
        <form id="venderuserlicense" method="post" enctype="multipart/form-data" @*action='@Url.Content("~/User/Saves")'*@>
            <table>
                <tr>
                    <td>证书类型:
                    </td>
                    <td>
                        <select id="LICENSE_TYPE" class="easyui-combogrid" name="LICENSE_TYPE" style="width: 120px;"
                            data-options="
                        idField:'Value',
                        textField:'Text',
                        url:'@Url.Content("/VenderUserLicense/LicenseTypeList?IsSetAll=false")',
                        columns:[[
                            {field:'Text',title:'证书类型',width:116}
                        ]]
                    ">
                    </select>
                    </td>
                    <td>有效日期:
                    </td>
                    <td colspan="2">
                        <input class="easyui-datebox" id="ValidDate" name="ValidDate" style="width: 154px;" editable="false" />
                    </td>
                </tr>
                <tr>
                    <td>证书图片:
                    </td>
                    <td>
                        <input id="ImgURL" type="hidden" name="ImgURL"/>
                        <input id="ImgName" type="hidden" name="ImgName"/>
                        <input id="FileUpload" type="file" name="files" style="width: 154px; height: 24px; background: White"
                            class="easyui-validatebox" />
                        <a id="btnImport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-upload'" onclick="Import()">导入</a>
                    </td>
                </tr>
                <tr id="image" style="display:none">
                    <td>
                        上传证书:
                    </td>
                    <td id="ShowImgName"></td>
                    <td colspan="3">
                        <a id="btnImageDel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="DeleteImage()">删除</a>
                    </td>
                </tr>
                <tr>
                    <td>备注:
                    </td>
                    <td colspan="4">
                        <input id="txtRemark" name="txtRemark" maxlength="255" style="width: 520px" />
                    </td>
                </tr>
                <tr>
                    <td>供应商：</td>
                    <td colspan="3">
                        <select id="VENDERID" class="easyui-combogrid" name="VENDERID" style="width: 370px;"
                            data-options="
                        idField:'VENDERID',
                        textField:'VENDERNAME',
                        url:'@Url.Content("/BaseData/VenderList?VenderID="+@Model.VENDERID)',
                        columns:[[
                            {field:'VENDERCODE',title:'编码',width:60},
                            {field:'VENDERNAME',title:'名称',width:288}
                        ]]
                    ">
                        </select>
                    </td>
                    <td>
                        <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="save()">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div id="p3" class="easyui-dialog" style="height:640px;width:620px;" closed="true" buttons="#dlg-buttons">
        <img id="ig2" src="" style="height:600px;width:600px;" />
    </div>
</body>
